package cn.gxa.j229.bug.finance.mapper;

import cn.gxa.j229.bug.finance.pojo.Ad;
import cn.gxa.j229.bug.finance.pojo.Loan;

import java.util.List;
import java.util.Map;

public interface LoanMapper {

    //进行中标的管理下架
    int deleteByNum(String num);

    int insert(Loan record);

    int insertSelective(Loan record);

    Loan selectById(Integer id);

    int updateByIdSelective(Loan record);

    int updateByNumSelective(Loan record);

    int updateById(Loan record);

    //标的上架维护接口对状态的更改
    int updateStateBynum(String num);

    List<Map<String,Object>> findById(Integer id);

    List<Map<String,Object>> findByPage(int limit, int page);

    /**
     * findByPage方法总记录数计算
     * @param
     * @param
     * @return
     */
    Integer findByPageCount();

    List<Map<String,Object>> findingByPage(Loan loan);

    /**
     * findingByPage方法的总记录数计算
     * @param loan
     * @return
     */
    Integer findingByPageCount(Loan loan);

    List<Map<String,Object>> findFinishByPage(Loan loan);

    /**
     * findFinishByPageCount方法的总记录数计算
     * @param loan
     * @return
     */
    Integer findFinishByPageCount(Loan loan);

    List<Map<String,Object>> findAll();

    List<Map<String,Object>> findLikeLoanDefend(Loan loan);
    Integer findLikeLoanDefendCount(Loan loan);

    List<Map<String,Object>> findLikeLoanCheck(Loan loan);
    Integer findLikeLoanCheckCount(Loan loan);


    //进行中标的管理条件查询：
    //根据手机号查询
    List<Map<String,Object>> selectByPhone(String phone);
    //根据借款方查询
    List<Map<String,Object>> selectByBorrower(String borrower);
    //进行中标的下架 只改变状态，不实际删除数据
    int update(Loan loan);

    int updating(Loan loan);

    int fullupdate(Loan loan);

    int updateByNumPass(String num);

    int updateByNumUnPass(String num);
}